//
//  MJNavigationController.m
//  快速集成下拉刷新
//
//  Created by apple on 13-12-23.
//  Copyright (c) 2013年 itcast. All rights reserved.
//
// 判断是否为iOS7

#import "CMNavigationController.h"
@implementation CMNavigationController

#pragma mark 一个类只会调用一次
+ (void)initialize
{
    // 1.取出设置主题的对象
    UINavigationBar *navBar = [UINavigationBar appearance];
    
    // 2.设置导航栏的背景图片
    UIImage *navBarBgImg = nil;
    if (iOS7) { // iOS7
        navBarBgImg = [Common drawImageSize:Size(Screen_Width, 64) Color:ColorRGB(91, 160, 255)];
        navBar.tintColor = [UIColor whiteColor];
    }
//    else { // 非iOS7
//        navBarBgImg = [Common drawImageSize:Size(Screen_Width, 44) Color:ColorRGB(91, 160, 255)];
//        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
//    }
    [navBar setBackgroundImage:navBarBgImg
                 forBarMetrics:UIBarMetricsDefault];
   
    
    // 3.标题
//    NSDictionary *attributesDic = @{UITextAttributeTextColor        : [UIColor whiteColor],
//                                    UITextAttributeTextShadowColor  : [UIColor blackColor],
//                                    UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake(0.5, 0.5)],
//                                    UITextAttributeFont             : [UIFont boldSystemFontOfSize:20.0]};
//    [navBar setTitleTextAttributes:attributesDic];
}

#pragma mark 控制状态栏的样式
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

@end